import request, {jsonToURLSearchParams} from "@/utils/request";

export function listArticle(params) {
  return request("/api/cms/article/list", {
    method: "POST",
    data: jsonToURLSearchParams(params)
  })
}


export function delArticle(id) {
  return request("/api/cms/article/remove", {
    method: "POST",
    data: jsonToURLSearchParams({
      ids: id
    })
  })
}


export function articleDetail(id) {
  return request(`/api/cms/article/open/detail/${id}`)
}

export function editArticle(articleInfo) {
  return request("/api/cms/article/edit", {
    method: "POST",
    data: jsonToURLSearchParams(articleInfo)
  })
}
